﻿using System;
using System.Runtime.InteropServices;

namespace MatlabBridge.NativeMethods
{
    internal static class libeng
    {
        [DllImport("libeng.dll")]
        public static extern IntPtr engOpen(string command);
        [DllImport("libeng.dll")]
        public static unsafe extern IntPtr engOpenSingleUse(string startcmd, IntPtr dcom, int* retstatus);
        [DllImport("libeng.dll")]
        public static extern int engClose(IntPtr ep);

        [DllImport("libeng.dll")]
        public static extern IntPtr engGetVariable(IntPtr ep, string name);
        [DllImport("libeng.dll")]
        public static extern int engPutVariable(IntPtr ep, string name, IntPtr pm);

        [DllImport("libeng.dll")]
        public static extern int engEvalString(IntPtr ep, string str);
        [DllImport("libeng.dll", CharSet=CharSet.Ansi)]
        public static extern int engOutputBuffer(IntPtr ep, IntPtr p, int n);

        [DllImport("libeng.dll")]
        public static unsafe extern int engGetVisible(IntPtr ep, bool* value);
        [DllImport("libeng.dll")]
        public static extern int engSetVisible(IntPtr ep, bool value);
    }
}
